Optimal. Leaf size=179 \[ -\frac {3 a x}{b^4}+\frac {3 a^2 \left (2 a^4-5 a^2 b^2+4 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b^4 \left (a^2-b^2\right )^{5/2}}-\frac {\left (3 a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )}+\frac {a^2 \cos (x) \sin ^2(x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {3 a^3 \left (a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )^2 (a+b \sin (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 179, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {2871, 3110,
3102, 2814, 2739, 632, 210} \begin {gather*} \frac {a^2 \sin ^2(x) \cos (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {\left (3 a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )}+\frac {3 a^2 \left (2 a^4-5 a^2 b^2+4 b^4\right ) \text {ArcTan}\left (\frac {a \tan \left (\frac {x}{2}\right )+b}{\sqrt {a^2-b^2}}\right )}{b^4 \left (a^2-b^2\right )^{5/2}}-\frac {3 a^3 \left (a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )^2 (a+b \sin (x))}-\frac {3 a x}{b^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2814
Rule 2871
Rule 3102
Rule 3110
Rubi steps
\begin {align*} \int \frac {\sin ^4(x)}{(a+b \sin (x))^3} \, dx &=\frac {a^2 \cos (x) \sin ^2(x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {\int \frac {\sin (x) \left (2 a^2-2 a b \sin (x)-\left (3 a^2-2 b^2\right ) \sin ^2(x)\right )}{(a+b \sin (x))^2} \, dx}{2 b \left (a^2-b^2\right )}\\ &=\frac {a^2 \cos (x) \sin ^2(x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {3 a^3 \left (a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )^2 (a+b \sin (x))}-\frac {\int \frac {3 a^2 b \left (a^2-2 b^2\right )+a \left (3 a^2-4 b^2\right ) \left (a^2-b^2\right ) \sin (x)-b \left (3 a^2-2 b^2\right ) \left (a^2-b^2\right ) \sin ^2(x)}{a+b \sin (x)} \, dx}{2 b^3 \left (a^2-b^2\right )^2}\\ &=-\frac {\left (3 a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )}+\frac {a^2 \cos (x) \sin ^2(x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {3 a^3 \left (a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )^2 (a+b \sin (x))}-\frac {\int \frac {3 a^2 b^2 \left (a^2-2 b^2\right )+6 a b \left (a^2-b^2\right )^2 \sin (x)}{a+b \sin (x)} \, dx}{2 b^4 \left (a^2-b^2\right )^2}\\ &=-\frac {3 a x}{b^4}-\frac {\left (3 a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )}+\frac {a^2 \cos (x) \sin ^2(x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {3 a^3 \left (a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\left (3 a^2 \left (2 a^4-5 a^2 b^2+4 b^4\right )\right ) \int \frac {1}{a+b \sin (x)} \, dx}{2 b^4 \left (a^2-b^2\right )^2}\\ &=-\frac {3 a x}{b^4}-\frac {\left (3 a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )}+\frac {a^2 \cos (x) \sin ^2(x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {3 a^3 \left (a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\left (3 a^2 \left (2 a^4-5 a^2 b^2+4 b^4\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b^4 \left (a^2-b^2\right )^2}\\ &=-\frac {3 a x}{b^4}-\frac {\left (3 a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )}+\frac {a^2 \cos (x) \sin ^2(x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {3 a^3 \left (a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )^2 (a+b \sin (x))}-\frac {\left (6 a^2 \left (2 a^4-5 a^2 b^2+4 b^4\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {x}{2}\right )\right )}{b^4 \left (a^2-b^2\right )^2}\\ &=-\frac {3 a x}{b^4}+\frac {3 a^2 \left (2 a^4-5 a^2 b^2+4 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b^4 \left (a^2-b^2\right )^{5/2}}-\frac {\left (3 a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )}+\frac {a^2 \cos (x) \sin ^2(x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {3 a^3 \left (a^2-2 b^2\right ) \cos (x)}{2 b^3 \left (a^2-b^2\right )^2 (a+b \sin (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 144, normalized size = 0.80 \begin {gather*} \frac {-6 a x+\frac {6 a^2 \left (2 a^4-5 a^2 b^2+4 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}-2 b \cos (x)+\frac {a^4 b \cos (x)}{(a-b) (a+b) (a+b \sin (x))^2}+\frac {a^3 b \left (-5 a^2+8 b^2\right ) \cos (x)}{(a-b)^2 (a+b)^2 (a+b \sin (x))}}{2 b^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.46, size = 286, normalized size = 1.60
method | result | size |
default | \(\frac {2 a^{2} \left (\frac {-\frac {3 a \,b^{2} \left (a^{2}-2 b^{2}\right ) \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {b \left (4 a^{4}+a^{2} b^{2}-14 b^{4}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {a \,b^{2} \left (13 a^{2}-22 b^{2}\right ) \tan \left (\frac {x}{2}\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {a^{2} b \left (4 a^{2}-7 b^{2}\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}}{\left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2 b \tan \left (\frac {x}{2}\right )+a \right )^{2}}+\frac {3 \left (2 a^{4}-5 a^{2} b^{2}+4 b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \sqrt {a^{2}-b^{2}}}\right )}{b^{4}}-\frac {2 \left (\frac {b}{\tan ^{2}\left (\frac {x}{2}\right )+1}+3 a \arctan \left (\tan \left (\frac {x}{2}\right )\right )\right )}{b^{4}}\) | \(286\) |
risch | \(-\frac {3 a x}{b^{4}}-\frac {{\mathrm e}^{i x}}{2 b^{3}}-\frac {{\mathrm e}^{-i x}}{2 b^{3}}+\frac {i a^{3} \left (-6 i a^{3} b \,{\mathrm e}^{3 i x}+9 i a \,b^{3} {\mathrm e}^{3 i x}+14 i a^{3} b \,{\mathrm e}^{i x}-23 i a \,b^{3} {\mathrm e}^{i x}+10 a^{4} {\mathrm e}^{2 i x}-11 a^{2} b^{2} {\mathrm e}^{2 i x}-8 b^{4} {\mathrm e}^{2 i x}-5 a^{2} b^{2}+8 b^{4}\right )}{\left (-i b \,{\mathrm e}^{2 i x}+i b +2 a \,{\mathrm e}^{i x}\right )^{2} \left (a^{2}-b^{2}\right )^{2} b^{4}}-\frac {3 a^{6} \ln \left ({\mathrm e}^{i x}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} b^{4}}+\frac {15 a^{4} \ln \left ({\mathrm e}^{i x}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{2 \sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} b^{2}}-\frac {6 a^{2} \ln \left ({\mathrm e}^{i x}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}+\frac {3 a^{6} \ln \left ({\mathrm e}^{i x}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} b^{4}}-\frac {15 a^{4} \ln \left ({\mathrm e}^{i x}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{2 \sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} b^{2}}+\frac {6 a^{2} \ln \left ({\mathrm e}^{i x}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}\) | \(624\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 441 vs.
\(2 (167) = 334\).
time = 0.45, size = 945, normalized size = 5.28 \begin {gather*} \left [\frac {12 \, {\left (a^{7} b^{2} - 3 \, a^{5} b^{4} + 3 \, a^{3} b^{6} - a b^{8}\right )} x \cos \left (x\right )^{2} + 4 \, {\left (a^{6} b^{3} - 3 \, a^{4} b^{5} + 3 \, a^{2} b^{7} - b^{9}\right )} \cos \left (x\right )^{3} - 3 \, {\left (2 \, a^{8} - 3 \, a^{6} b^{2} - a^{4} b^{4} + 4 \, a^{2} b^{6} - {\left (2 \, a^{6} b^{2} - 5 \, a^{4} b^{4} + 4 \, a^{2} b^{6}\right )} \cos \left (x\right )^{2} + 2 \, {\left (2 \, a^{7} b - 5 \, a^{5} b^{3} + 4 \, a^{3} b^{5}\right )} \sin \left (x\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2} + 2 \, {\left (a \cos \left (x\right ) \sin \left (x\right ) + b \cos \left (x\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right ) - 12 \, {\left (a^{9} - 2 \, a^{7} b^{2} + 2 \, a^{3} b^{6} - a b^{8}\right )} x - 2 \, {\left (6 \, a^{8} b - 15 \, a^{6} b^{3} + 7 \, a^{4} b^{5} + 4 \, a^{2} b^{7} - 2 \, b^{9}\right )} \cos \left (x\right ) - 2 \, {\left (12 \, {\left (a^{8} b - 3 \, a^{6} b^{3} + 3 \, a^{4} b^{5} - a^{2} b^{7}\right )} x + {\left (9 \, a^{7} b^{2} - 25 \, a^{5} b^{4} + 20 \, a^{3} b^{6} - 4 \, a b^{8}\right )} \cos \left (x\right )\right )} \sin \left (x\right )}{4 \, {\left (a^{8} b^{4} - 2 \, a^{6} b^{6} + 2 \, a^{2} b^{10} - b^{12} - {\left (a^{6} b^{6} - 3 \, a^{4} b^{8} + 3 \, a^{2} b^{10} - b^{12}\right )} \cos \left (x\right )^{2} + 2 \, {\left (a^{7} b^{5} - 3 \, a^{5} b^{7} + 3 \, a^{3} b^{9} - a b^{11}\right )} \sin \left (x\right )\right )}}, \frac {6 \, {\left (a^{7} b^{2} - 3 \, a^{5} b^{4} + 3 \, a^{3} b^{6} - a b^{8}\right )} x \cos \left (x\right )^{2} + 2 \, {\left (a^{6} b^{3} - 3 \, a^{4} b^{5} + 3 \, a^{2} b^{7} - b^{9}\right )} \cos \left (x\right )^{3} - 3 \, {\left (2 \, a^{8} - 3 \, a^{6} b^{2} - a^{4} b^{4} + 4 \, a^{2} b^{6} - {\left (2 \, a^{6} b^{2} - 5 \, a^{4} b^{4} + 4 \, a^{2} b^{6}\right )} \cos \left (x\right )^{2} + 2 \, {\left (2 \, a^{7} b - 5 \, a^{5} b^{3} + 4 \, a^{3} b^{5}\right )} \sin \left (x\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \sin \left (x\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (x\right )}\right ) - 6 \, {\left (a^{9} - 2 \, a^{7} b^{2} + 2 \, a^{3} b^{6} - a b^{8}\right )} x - {\left (6 \, a^{8} b - 15 \, a^{6} b^{3} + 7 \, a^{4} b^{5} + 4 \, a^{2} b^{7} - 2 \, b^{9}\right )} \cos \left (x\right ) - {\left (12 \, {\left (a^{8} b - 3 \, a^{6} b^{3} + 3 \, a^{4} b^{5} - a^{2} b^{7}\right )} x + {\left (9 \, a^{7} b^{2} - 25 \, a^{5} b^{4} + 20 \, a^{3} b^{6} - 4 \, a b^{8}\right )} \cos \left (x\right )\right )} \sin \left (x\right )}{2 \, {\left (a^{8} b^{4} - 2 \, a^{6} b^{6} + 2 \, a^{2} b^{10} - b^{12} - {\left (a^{6} b^{6} - 3 \, a^{4} b^{8} + 3 \, a^{2} b^{10} - b^{12}\right )} \cos \left (x\right )^{2} + 2 \, {\left (a^{7} b^{5} - 3 \, a^{5} b^{7} + 3 \, a^{3} b^{9} - a b^{11}\right )} \sin \left (x\right )\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 256, normalized size = 1.43 \begin {gather*} \frac {3 \, {\left (2 \, a^{6} - 5 \, a^{4} b^{2} + 4 \, a^{2} b^{4}\right )} {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, x\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{4} b^{4} - 2 \, a^{2} b^{6} + b^{8}\right )} \sqrt {a^{2} - b^{2}}} - \frac {3 \, a^{5} b \tan \left (\frac {1}{2} \, x\right )^{3} - 6 \, a^{3} b^{3} \tan \left (\frac {1}{2} \, x\right )^{3} + 4 \, a^{6} \tan \left (\frac {1}{2} \, x\right )^{2} + a^{4} b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 14 \, a^{2} b^{4} \tan \left (\frac {1}{2} \, x\right )^{2} + 13 \, a^{5} b \tan \left (\frac {1}{2} \, x\right ) - 22 \, a^{3} b^{3} \tan \left (\frac {1}{2} \, x\right ) + 4 \, a^{6} - 7 \, a^{4} b^{2}}{{\left (a^{4} b^{3} - 2 \, a^{2} b^{5} + b^{7}\right )} {\left (a \tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, x\right ) + a\right )}^{2}} - \frac {3 \, a x}{b^{4}} - \frac {2}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )} b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 14.87, size = 2500, normalized size = 13.97 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________